<template>
  <div >
    <yfu-rich-text ref="richText" :currentRow="param"></yfu-rich-text>
    <div style="width:100%;text-align: right">
      <el-button @click="returnPre">取消</el-button>
      <el-button type="primary" @click="save">保存</el-button>
    </div>
  </div>
</template>
<script type="text/javascript">
  import yfuRichText from '@/components/common/yfuRichText.vue'
  import { yfuPost } from '@/utils/request.js'
  import { updateDesc } from '@/view/website/api/company.js'
  import {yfuSuccessToast} from '@/utils/yfuMessage.js'
  export default {
    props: ['param'],
    components: {
      'yfuRichText': yfuRichText
    },
    data () {
      return {
        currentRow: {},
        content: ''
      }
    },
    created () {
      this.openDialog()
    },
    methods: {
      openDialog () {
//        let cThis = this
//        let url = baseProURL.ip2 + projectOnePro.url
//        tfGet(url, function (data) {
//          cThis.currentRow = data
//          cThis.content = data.projectDetail
//        })
      },
      returnPre () {
        this.$emit('returnPreNoRefresh')
      },
      save () {
        let cThis = this
        let con = this.$refs.richText.getContent()
        yfuPost(process.env.BASE_API, updateDesc.url, {gwCompanyId: this.param.gwCompanyId, gwCompanyIntro: con}, function (data) {
          yfuSuccessToast('保存成功')
          cThis.$emit('returnPre')
        })
      }
    }
  }
</script>

